package com.myway.components.esb;

import com.myway.core.jersey.client.HttpClient;

/**
 * @ClassName: ESBRequestDemo <br/>
 * @Description: 调用事例 <br/>
 * @CreateDate: 2016年5月18日 下午3:13:38 <br/>
 * @author Toby
 * @version V1.0
 */
public class ESBRequestDemo {

	static String json="{'telString':'18108181185'}";
	//接送机询价接口（日期需要大于当前）
	static String json1="{\"TripType\":1,\"PuCity\":\"上海\",\"PuAddress\":\"人民广场\",\"AirportCode\":\"SHA\",\"PuLat\":\"31.202028\",\"PuLng\":\"121.3379\",\"DestCity\":\"上海\",\"DestAddress\":\"唐镇\",\"DestLat\":\"31.238098\",\"DestLng\":\"121.480838\",\"CarTypeLevelLst\":[],\"PickUpDateTime\":\"2016-6-28 19:10:00\"}";
	//接送机创建订单（供应商订单号否则生成两个相同订单,修改上车时间）
	static String json2="{\"TripType\": 1,\"PurchaseOrderNo\": \"136790123142\", \"OrderName\": \"网爸\",  \"OrderCellPhone\": \"1134124444\",  \"PickUpDateTime\": \"2016-6-10 19: 10: 00\", \"PuCity\": \"上海\",\"PuAddress\": \"人民广场\", \"DestCity\": \"上海\",\"DestAddress\": \"唐镇\", \"CarTypeLevel\": 2, \"CarType\": 0, \"PuLat\": \"31.202028\",\"PuLng\": \"121.3379\",\"DestLat\": \"31.238098\", \"DestLng\": \"121.480838\", \"AirportCode\": \"SHA\", \"Price\": 144.0, \"PriceDetailLst\": [ ]}";
	//拿到创建订单的id去下单
	static String json3="{\"id\":15150}";
	//按状态查询接送机订单
	static String json4="{\"status\":CREATE}";
	//生成辅营订单
	static String json5="[{'paxId':15321027,'productList':[{'productId':165,'type':'PAYMEAL'}],'passengerName':'王二444','identificationType':'身份证','identificationNo':'32413412341234','usePoint':false,'userId':'user333','remark':'贵宾厅'}]";
	//查询快速登离机
	static String json6="{\"channel\":\"B2C\"}";
	//查询快速登离机
	static String json7="{\"city\":\"北京\"}";
	public static void main(String[] args) {
		String returnMessageStr ="";
//		json="{'orgCity':'CTU','dstCity':'SHA','date':'2016-10-13 00:00:00','dayAhead':1,'airlineCode':'EU'} ";
		json="{'name':'SCADMIN','password':'SCADMIN123','cnname':'孙晓欧','fltdate':'2017-02-03','fltnum':'SC8781','reservedSeat':'18A','fphone':'13844358615','fcardType':'ID'}";
//		returnMessageStr= ESBClient.invoke(ESBEnum.BehaviorAnalysis, json);
//		https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18612185835
//		http://localhost:8081/etair-project/resource/weatherResources/queryTelephone
//		returnMessageStr=GzipClient.post("http://10.2.1.2:8081/CommonServices/resource/weatherResources/queryTelephone", json, false, false);
//		returnMessageStr=HttpClient.post("https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=18612185835", "", "json");
		returnMessageStr=HttpClient.post("http://localhost:8082/pactera-scffp/restService/userservice/0.2/registerScan/InsertScan", json, "json");
		
//		returnMessageStr=weatherUtil.requestTaobaoTelephone("18612185835");
//		DTOTelephoneResult dTOTelephone = GsonUtil.fromJson(returnMessageStr, DTOTelephoneResult.class);
		
//		json="{'totalAirportTax':50.0,'totalFuelTax':0.0,'totalSubsidiary':16.1,'ticketType':'ELECTRONIC_TICKET','userId':706,'currency':'CNY','status':'WP','contactName':'高天滨','contactMobile':'18610913361','contactEmail':'18610913361@qq.com','pnrImport':false,'issurSMSSend':0,'illnessAnnex':[],'bookingType':'INDIVIDUAL','segmentList':[{'depCode':'CTU','arrCode':'CSX','airlineCode':'EU','flightNo':'EU2205','cabinClass':'H','depTime':'2016-08-15 07:25:00','depTimeforTQ':'2016-08-15 00:00:00','arrTime':'2016-08-15 09:15:00','planeType':'319','inventory':'IBE','cabinState':'OP','tripType':'ONEWAY','cabinPrice':810.0,'baseFare':1010.0,'referenceFare':0.0}],'passengerList':[{'name':'高天滨','passengerType':'ADULT','gender':'MALE','certificateNo':'231121198904150632','certificateType':'NI','passengerSegmentList':[{'marketFare':810.0,'netFare':810.0,'airportTax':50.0,'fuelTax':0.0,'otherTaxes':0.0,'insurance':0.0,'agentFeeRate':0.0,'spFeeRate':0.0,'agentFee':0.0,'spFee':0.0,'status':'HK','sequence':0,'seatList':[],'serviceList':[],'insuranceList':[],'paxsegTaxList':[],'supportBusinessList':[{'supportBusinessId':165,'supportBusinessType':'PAYMEAL'}],'pointPrice':0.0,'realRebate':0.0,'depCode':'CTU','arrCode':'CSX','airlineCode':'EU','flightNo':'EU2205','cabinClass':'H','depTime':'2016-08-15 07:25:00','depTimeforTQ':'2016-08-15 00:00:00','arrTime':'2016-08-15 09:15:00','planeType':'319','inventory':'IBE','cabinState':'OP','tripType':'ONEWAY','cabinPrice':810.0,'baseFare':1010.0,'point':0,'referenceFare':0.0}],'ticketMoney':'0','airportTaxMoney':'0','fuelTaxMoney':'0','allMoney':'0','insuranceAmount':'0','isInsure':0,'insurance1':0,'insurance2':0,'isSaveCommonPassenger':0,'mobilePhone':'18610913361','isFlightSms':0}],'refund':[],'payments':[],'fltChange':[],'extbuyList':[],'orderPoint':0,'needFreeTickets':0,'orderAmount':876.10,'ticketprice':810.00,'pointAmount':0.0,'international':0,'groupMark':0}";
//		returnMessageStr=GzipClient.post("http://10.2.1.208:6070/CLKBackend/resouce/clkresouce/queryAccumulatedIntegral", json, false, false);

//		json="{'status':'WP','source':'B2C','pageSize':10,'currentPageNum':1,descName:{'id':'desc','createTime':'desc'}}";
////		returnMessageStr=GzipClient.post("http://localhost:8081/etair-project/resource/orderResource/generateOrder", json, false, false);
//		returnMessageStr=ESBClient.invoke(ESBEnum.GetOrderList, json);
//		json="{'orgCity':'CTU','dstCity':'PVG','date':'2016-7-26 00:00:00','tripType':'ONEWAY','airlineCode':'EU'}";
//		returnMessageStr=GzipClient.post("http://10.2.1.2:8888/CommonServices/resource/flightResource/searchLowestFares", json, false, false);
		
//		returnMessageStr=HttpClient.post("http://api.map.baidu.com/telematics/v3/weather?location=北京&output=json&ak=OohuPfRQLxGVyPsu0mQvrFsUtiMA9QVu", "", false, false);
		System.out.println(returnMessageStr);
	    
	}
}
